<?php
define("EW_PAGE_ID", "edit", TRUE); // Page ID
define("EW_TABLE_NAME", 'movie', TRUE);
?>
<?php 
session_start(); // Initialize session data
ob_start(); // Turn on output buffering
?>
<?php include "ewcfg50.php" ?>
<?php include "ewmysql50.php" ?>
<?php include "phpfn50.php" ?>
<?php include "movieinfo.php" ?>
<?php include "userfn50.php" ?>
<?php include "usersinfo.php" ?>
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // Always modified
header("Cache-Control: private, no-store, no-cache, must-revalidate"); // HTTP/1.1 
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
?>
<?php

// Open connection to the database
$conn = ew_Connect();
?>
<?php
$Security = new cAdvancedSecurity();
?>
<?php
if (!$Security->IsLoggedIn()) $Security->AutoLogin();
$Security->LoadCurrentUserLevel('movie');
if (!$Security->IsLoggedIn()) {
	$Security->SaveLastUrl();
	Page_Terminate("login.php");
}
if (!$Security->CanEdit()) {
	$Security->SaveLastUrl();
	Page_Terminate("movielist.php");
}
?>
<?php

// Common page loading event (in userfn*.php)
Page_Loading();
?>
<?php

// Page load event, used in current page
Page_Load();
?>
<?php
$movie->Export = @$_GET["export"]; // Get export parameter
$sExport = $movie->Export; // Get export parameter, used in header
$sExportFile = $movie->TableVar; // Get export file, used in header
?>
<?php

// Load key from QueryString
if (@$_GET["id"] <> "") {
	$movie->id->setQueryStringValue($_GET["id"]);
}

// Create form object
$objForm = new cFormObj();
if (@$_POST["a_edit"] <> "") {
	$movie->CurrentAction = $_POST["a_edit"]; // Get action code
	GetUploadFiles(); // Get upload files
	LoadFormValues(); // Get form values
} else {
	$movie->CurrentAction = "I"; // Default action is display
}

// Check if valid key
if ($movie->id->CurrentValue == "") Page_Terminate($movie->getReturnUrl()); // Invalid key, exit
switch ($movie->CurrentAction) {
	case "I": // Get a record to display
		if (!LoadRow()) { // Load Record based on key
			$_SESSION[EW_SESSION_MESSAGE] = "No records found"; // No record found
			Page_Terminate($movie->getReturnUrl()); // Return to caller
		}
		break;
	Case "U": // Update
		$movie->SendEmail = TRUE; // Send email on update success
		if (EditRow()) { // Update Record based on key
			$_SESSION[EW_SESSION_MESSAGE] = "Update successful"; // Update success
			Page_Terminate($movie->getReturnUrl()); // Return to caller
		} else {
			RestoreFormValues(); // Restore form values if update failed
		}
}

// Render the record
$movie->RowType = EW_ROWTYPE_EDIT; // Render as edit
RenderRow();
?>
<?php include "header.php" ?>
<script type="text/javascript">
<!--
var EW_PAGE_ID = "edit"; // Page id
var EW_SHOW_HIGHLIGHT = "Show highlight"; 
var EW_HIDE_HIGHLIGHT = "Hide highlight";

//-->
</script>
<script type="text/javascript">
<!--

function ew_ValidateForm(fobj) {
	if (fobj.a_confirm && fobj.a_confirm.value == "F")
		return true;
	var i, elm, aelm, infix;
	var rowcnt = (fobj.key_count) ? Number(fobj.key_count.value) : 1;
	for (i=0; i<rowcnt; i++) {
		infix = (fobj.key_count) ? String(i+1) : "";
		elm = fobj.elements["x" + infix + "_mv_id"];
		if (elm && !ew_HasValue(elm)) {
			if (!ew_OnError(elm, "Please enter required field - mv id"))
				return false;
		}
		elm = fobj.elements["x" + infix + "_mv_name"];
		if (elm && !ew_HasValue(elm)) {
			if (!ew_OnError(elm, "Please enter required field - Name"))
				return false;
		}
		elm = fobj.elements["x" + infix + "_mv_smallimg"];
		aelm = fobj.elements["a" + infix + "_mv_smallimg"];
		var chk_mv_smallimg = (aelm && aelm[0])?(aelm[2].checked):true;
		if (elm && chk_mv_smallimg && !ew_HasValue(elm)) {
			if (!ew_OnError(elm, "Please enter required field - Small Image"))
				return false;
		}
		elm = fobj.elements["x" + infix + "_mv_smallimg"];
		if (elm && !ew_CheckFileType(elm.value)) { 
			if (!ew_OnError(elm, "File type is not allowed.")) 
				return false; 
		}
		elm = fobj.elements["x" + infix + "_mv_bigimg"];
		if (elm && !ew_CheckFileType(elm.value)) { 
			if (!ew_OnError(elm, "File type is not allowed.")) 
				return false; 
		}
		elm = fobj.elements["x" + infix + "_mv_capacity"];
		if (elm && !ew_CheckInteger(elm.value)) {
			if (!ew_OnError(elm, "Incorrect integer - Capacity"))
				return false; 
		}
		elm = fobj.elements["x" + infix + "_mv_year"];
		if (elm && !ew_CheckInteger(elm.value)) {
			if (!ew_OnError(elm, "Incorrect integer - Year"))
				return false; 
		}
		elm = fobj.elements["x" + infix + "_mv_dateadd"];
		if (elm && !ew_CheckEuroDate(elm.value)) {
			if (!ew_OnError(elm, "Incorrect date, format = dd/mm/yyyy - Dateadd"))
				return false; 
		}
	}
	return true;
}

//-->
</script>
<script type="text/javascript" src="fckeditor/fckeditor.js"></script>
<script type="text/javascript">
<!--
_width_multiplier = 16;
_height_multiplier = 60;
var ew_DHTMLEditors = [];

function ew_UpdateTextArea() {
	if (typeof ew_DHTMLEditors != 'undefined' &&
		typeof FCKeditorAPI != 'undefined') {			
			var inst;			
			for (inst in FCKeditorAPI.__Instances)
				FCKeditorAPI.__Instances[inst].UpdateLinkedField();
	}
}

//-->
</script>
<link rel="stylesheet" type="text/css" media="all" href="calendar/calendar-win2k-1.css" title="win2k-1" />
<script type="text/javascript" src="calendar/calendar.js"></script>
<script type="text/javascript" src="calendar/lang/calendar-en.js"></script>
<script type="text/javascript" src="calendar/calendar-setup.js"></script>
<script type="text/javascript">
<!--
var ew_MultiPagePage = "Page"; // multi-page Page Text
var ew_MultiPageOf = "of"; // multi-page Of Text
var ew_MultiPagePrev = "Prev"; // multi-page Prev Text
var ew_MultiPageNext = "Next"; // multi-page Next Text

//-->
</script>
<script language="JavaScript" type="text/javascript">
<!--

// Write your client script here, no need to add script tags.
// To include another .js script, use:
// ew_ClientScriptInclude("my_javascript.js"); 
//-->

</script>
<p><span class="phpmaker">Edit TABLE: movie<br><br><a href="<?php echo $movie->getReturnUrl() ?>">Go Back</a></span></p>
<?php
if (@$_SESSION[EW_SESSION_MESSAGE] <> "") {
?>
<p><span class="ewmsg"><?php echo $_SESSION[EW_SESSION_MESSAGE] ?></span></p>
<?php
	$_SESSION[EW_SESSION_MESSAGE] = ""; // Clear message
}
?>
<form name="fmovieedit" id="fmovieedit" action="movieedit.php" method="post" enctype="multipart/form-data">
<p>
<input type="hidden" name="a_edit" id="a_edit" value="U">
<table class="ewTable">
	<tr class="ewTableRow">
		<td class="ewTableHeader">id</td>
		<td<?php echo $movie->id->CellAttributes() ?>><span id="cb_x_id">
<div<?php echo $movie->id->ViewAttributes() ?>><?php echo $movie->id->EditValue ?></div>
<input type="hidden" name="x_id" id="x_id" value="<?php echo ew_HtmlEncode($movie->id->CurrentValue) ?>">
</span></td>
	</tr>
	<tr class="ewTableAltRow">
		<td class="ewTableHeader">mv id<span class='ewmsg'>&nbsp;*</span></td>
		<td<?php echo $movie->mv_id->CellAttributes() ?>><span id="cb_x_mv_id">
<input type="text" name="x_mv_id" id="x_mv_id"  size="30" maxlength="20" value="<?php echo $movie->mv_id->EditValue ?>"<?php echo $movie->mv_id->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableRow">
		<td class="ewTableHeader">Parent ID</td>
		<td<?php echo $movie->parent_id->CellAttributes() ?>><span id="cb_x_parent_id">
<select id="x_parent_id" name="x_parent_id" onChange="ew_AjaxUpdateOpt(this.form.x_sub_id, this, true);"<?php echo $movie->parent_id->EditAttributes() ?>>
<!--option value="">Please Select</option-->
<?php
if (is_array($movie->parent_id->EditValue)) {
	$arwrk = $movie->parent_id->EditValue;
	$rowswrk = count($arwrk);
	for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
		$selwrk = (strval($movie->parent_id->CurrentValue) == strval($arwrk[$rowcntwrk][0])) ? " selected" : "";	
?>
<option value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?>>
<?php echo $arwrk[$rowcntwrk][1] ?>
</option>
<?php
			}
}
?>
</select>
</span></td>
	</tr>
	<tr class="ewTableAltRow">
		<td class="ewTableHeader">Sub ID</td>
		<td<?php echo $movie->sub_id->CellAttributes() ?>><span id="cb_x_sub_id">
<select id="x_sub_id" name="x_sub_id"<?php echo $movie->sub_id->EditAttributes() ?>>
<!--option value="">Please Select</option-->
<?php
if (is_array($movie->sub_id->EditValue)) {
	$arwrk = $movie->sub_id->EditValue;
	$rowswrk = count($arwrk);
	for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
		$selwrk = (strval($movie->sub_id->CurrentValue) == strval($arwrk[$rowcntwrk][0])) ? " selected" : "";	
?>
<option value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?>>
<?php echo $arwrk[$rowcntwrk][1] ?>
</option>
<?php
			}
}
?>
</select>
<?php
$sSqlWrk = "SELECT `sub_id`, `sub_name` FROM `subcat`";
$sSqlWrk .= " WHERE (`parent_id` IN (@FILTER_VALUE))";
$sSqlWrk .= " AND (" . "`sub_type`='4'" . ")";
$sSqlWrk .= " ORDER BY `sub_order` Desc";
$sSqlWrk = TEAencrypt($sSqlWrk, EW_RANDOM_KEY);
?>
<input type="hidden" name="s_x_sub_id" id="s_x_sub_id" value="<?php echo $sSqlWrk ?>"><input type="hidden" name="lc_x_sub_id" id="lc_x_sub_id" value="2"><input type="hidden" name="ld1_x_sub_id" id="ld1_x_sub_id" value="1"><input type="hidden" name="ld2_x_sub_id" id="ld2_x_sub_id" value="-1"><input type="hidden" name="lft_x_sub_id" id="lft_x_sub_id" value="1">
</span></td>
	</tr>
	<tr class="ewTableRow">
		<td class="ewTableHeader">Name<span class='ewmsg'>&nbsp;*</span></td>
		<td<?php echo $movie->mv_name->CellAttributes() ?>><span id="cb_x_mv_name">
<input type="text" name="x_mv_name" id="x_mv_name"  size="30" maxlength="250" value="<?php echo $movie->mv_name->EditValue ?>"<?php echo $movie->mv_name->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableAltRow">
		<td class="ewTableHeader">Name English</td>
		<td<?php echo $movie->mv_name_en->CellAttributes() ?>><span id="cb_x_mv_name_en">
<input type="text" name="x_mv_name_en" id="x_mv_name_en"  size="30" maxlength="250" value="<?php echo $movie->mv_name_en->EditValue ?>"<?php echo $movie->mv_name_en->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableRow">
		<td class="ewTableHeader">Small Image<span class='ewmsg'>&nbsp;*</span></td>
		<td<?php echo $movie->mv_smallimg->CellAttributes() ?>><span id="cb_x_mv_smallimg">
<?php if (!is_null($movie->mv_smallimg->Upload->DbValue)) { ?>
<input type="radio" name="a_mv_smallimg" id="a_mv_smallimg" value="1" checked>Keep&nbsp;
<input type="radio" name="a_mv_smallimg" id="a_mv_smallimg" value="2" disabled>Remove&nbsp;
<input type="radio" name="a_mv_smallimg" id="a_mv_smallimg" value="3">Replace<br>
<?php } else { ?>
<input type="hidden" name="a_mv_smallimg" id="a_mv_smallimg" value="3">
<?php } ?>
<input type="file" name="x_mv_smallimg" id="x_mv_smallimg"  size="30" onchange="if (this.form.a_mv_smallimg[2]) this.form.a_mv_smallimg[2].checked=true;"<?php echo $movie->mv_smallimg->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableAltRow">
		<td class="ewTableHeader">Big Image</td>
		<td<?php echo $movie->mv_bigimg->CellAttributes() ?>><span id="cb_x_mv_bigimg">
<?php if (!is_null($movie->mv_bigimg->Upload->DbValue)) { ?>
<input type="radio" name="a_mv_bigimg" id="a_mv_bigimg" value="1" checked>Keep&nbsp;
<input type="radio" name="a_mv_bigimg" id="a_mv_bigimg" value="2">Remove&nbsp;
<input type="radio" name="a_mv_bigimg" id="a_mv_bigimg" value="3">Replace<br>
<?php } else { ?>
<input type="hidden" name="a_mv_bigimg" id="a_mv_bigimg" value="3">
<?php } ?>
<input type="file" name="x_mv_bigimg" id="x_mv_bigimg"  size="30" onchange="if (this.form.a_mv_bigimg[2]) this.form.a_mv_bigimg[2].checked=true;"<?php echo $movie->mv_bigimg->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableRow">
		<td class="ewTableHeader">Content</td>
		<td<?php echo $movie->mv_content->CellAttributes() ?>><span id="cb_x_mv_content">
<textarea name="x_mv_content" id="x_mv_content" cols="35" rows="10"<?php echo $movie->mv_content->EditAttributes() ?>><?php echo $movie->mv_content->EditValue ?></textarea>
<script type="text/javascript">
<!--
var editor = new ew_DHTMLEditor("x_mv_content");
editor.create = function() {
	var sBasePath = 'fckeditor/';
	var oFCKeditor = new FCKeditor('x_mv_content', 35*_width_multiplier, 10*_height_multiplier);
	oFCKeditor.BasePath = sBasePath;
	oFCKeditor.ReplaceTextarea();
	this.active = true;
}
ew_DHTMLEditors[ew_DHTMLEditors.length] = editor;
-->
</script>
</span></td>
	</tr>
	<tr class="ewTableAltRow">
		<td class="ewTableHeader">Detail</td>
		<td<?php echo $movie->mv_detail->CellAttributes() ?>><span id="cb_x_mv_detail">
<textarea name="x_mv_detail" id="x_mv_detail" cols="35" rows="10"<?php echo $movie->mv_detail->EditAttributes() ?>><?php echo $movie->mv_detail->EditValue ?></textarea>
<script type="text/javascript">
<!--
var editor = new ew_DHTMLEditor("x_mv_detail");
editor.create = function() {
	var sBasePath = 'fckeditor/';
	var oFCKeditor = new FCKeditor('x_mv_detail', 35*_width_multiplier, 10*_height_multiplier);
	oFCKeditor.BasePath = sBasePath;
	oFCKeditor.ReplaceTextarea();
	this.active = true;
}
ew_DHTMLEditors[ew_DHTMLEditors.length] = editor;
-->
</script>
</span></td>
	</tr>
	<tr class="ewTableRow">
		<td class="ewTableHeader">Hard Disk</td>
		<td<?php echo $movie->mv_harddisk->CellAttributes() ?>><span id="cb_x_mv_harddisk">
<input type="text" name="x_mv_harddisk" id="x_mv_harddisk"  size="30" maxlength="10" value="<?php echo $movie->mv_harddisk->EditValue ?>"<?php echo $movie->mv_harddisk->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableAltRow">
		<td class="ewTableHeader">Path</td>
		<td<?php echo $movie->mv_path->CellAttributes() ?>><span id="cb_x_mv_path">
<input type="text" name="x_mv_path" id="x_mv_path"  size="30" maxlength="250" value="<?php echo $movie->mv_path->EditValue ?>"<?php echo $movie->mv_path->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableRow">
		<td class="ewTableHeader">Capacity</td>
		<td<?php echo $movie->mv_capacity->CellAttributes() ?>><span id="cb_x_mv_capacity">
<input type="text" name="x_mv_capacity" id="x_mv_capacity"  size="30" maxlength="100" value="<?php echo $movie->mv_capacity->EditValue ?>"<?php echo $movie->mv_capacity->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableAltRow">
		<td class="ewTableHeader">Year</td>
		<td<?php echo $movie->mv_year->CellAttributes() ?>><span id="cb_x_mv_year">
<input type="text" name="x_mv_year" id="x_mv_year"  size="30" maxlength="100" value="<?php echo $movie->mv_year->EditValue ?>"<?php echo $movie->mv_year->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableRow">
		<td class="ewTableHeader">Subtitles</td>
		<td<?php echo $movie->mv_subtitles->CellAttributes() ?>><span id="cb_x_mv_subtitles">
<input type="text" name="x_mv_subtitles" id="x_mv_subtitles"  size="30" maxlength="250" value="<?php echo $movie->mv_subtitles->EditValue ?>"<?php echo $movie->mv_subtitles->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableAltRow">
		<td class="ewTableHeader">Resolution</td>
		<td<?php echo $movie->mv_resolution->CellAttributes() ?>><span id="cb_x_mv_resolution">
<input type="text" name="x_mv_resolution" id="x_mv_resolution"  size="30" maxlength="250" value="<?php echo $movie->mv_resolution->EditValue ?>"<?php echo $movie->mv_resolution->EditAttributes() ?>>
</span></td>
	</tr>
	<tr class="ewTableRow">
		<td class="ewTableHeader">Price</td>
		<td<?php echo $movie->mv_price->CellAttributes() ?>><span id="cb_x_mv_price">
<select id="x_mv_price" name="x_mv_price"<?php echo $movie->mv_price->EditAttributes() ?>>
<!--option value="">Please Select</option-->
<?php
if (is_array($movie->mv_price->EditValue)) {
	$arwrk = $movie->mv_price->EditValue;
	$rowswrk = count($arwrk);
	for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
		$selwrk = (strval($movie->mv_price->CurrentValue) == strval($arwrk[$rowcntwrk][0])) ? " selected" : "";	
?>
<option value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?>>
<?php echo $arwrk[$rowcntwrk][1] ?>
</option>
<?php
			}
}
?>
</select>
</span></td>
	</tr>
	<tr class="ewTableAltRow">
		<td class="ewTableHeader">Dateadd</td>
		<td<?php echo $movie->mv_dateadd->CellAttributes() ?>><span id="cb_x_mv_dateadd">
<input type="text" name="x_mv_dateadd" id="x_mv_dateadd"  size="30" maxlength="100" value="<?php echo $movie->mv_dateadd->EditValue ?>"<?php echo $movie->mv_dateadd->EditAttributes() ?>>
&nbsp;<img src="images/ew_calendar.gif" id="cx_mv_dateadd" alt="Pick a Date" style="cursor:pointer;cursor:hand;">
<script type="text/javascript">
Calendar.setup(
{
inputField : "x_mv_dateadd", // ID of the input field
ifFormat : "%d/%m/%Y", // the date format
button : "cx_mv_dateadd" // ID of the button
}
);
</script>
</span></td>
	</tr>
	<tr class="ewTableRow">
		<td class="ewTableHeader">Status</td>
		<td<?php echo $movie->mv_status->CellAttributes() ?>><span id="cb_x_mv_status">
<?php
$arwrk = $movie->mv_status->EditValue;
if (is_array($arwrk)) {
	$rowswrk = count($arwrk);
	for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
		$selwrk = (strval($movie->mv_status->CurrentValue) == strval($arwrk[$rowcntwrk][0])) ? " checked" : "";
?>
<?php echo ew_RepeatColumnTable($rowswrk, $rowcntwrk, 5, 1) ?>
<input type="radio" name="x_mv_status" id="x_mv_status" value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?><?php echo $movie->mv_status->EditAttributes() ?>>
<?php echo $arwrk[$rowcntwrk][1] ?>
<?php echo ew_RepeatColumnTable($rowswrk, $rowcntwrk, 5, 2) ?>
<?php
	}
}
?>
</span></td>
	</tr>
	<tr class="ewTableAltRow">
		<td class="ewTableHeader">Home Page</td>
		<td<?php echo $movie->mv_homepage->CellAttributes() ?>><span id="cb_x_mv_homepage">
<?php
$arwrk = $movie->mv_homepage->EditValue;
if (is_array($arwrk)) {
	$armultiwrk= explode(",", strval($movie->mv_homepage->CurrentValue));
	$rowswrk = count($arwrk);
	for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
		$selwrk = "";
		for ($ari = 0; $ari < count($armultiwrk); $ari++) {
			if (strval($arwrk[$rowcntwrk][0]) == trim(strval($armultiwrk[$ari]))) {
				$selwrk = " checked";
				break;
			}
		}
?>
<?php echo ew_RepeatColumnTable($rowswrk, $rowcntwrk, 5, 1) ?>
<input type="checkbox" name="x_mv_homepage[]" id="x_mv_homepage[]" value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?><?php echo $movie->mv_homepage->EditAttributes() ?>>
<?php echo $arwrk[$rowcntwrk][1] ?>
<?php echo ew_RepeatColumnTable($rowswrk, $rowcntwrk, 5, 2) ?>
<?php
	}
}
?>
</span></td>
	</tr>
	<tr class="ewTableRow">
		<td class="ewTableHeader">Active</td>
		<td<?php echo $movie->mv_active->CellAttributes() ?>><span id="cb_x_mv_active">
<?php
$arwrk = $movie->mv_active->EditValue;
if (is_array($arwrk)) {
	$armultiwrk= explode(",", strval($movie->mv_active->CurrentValue));
	$rowswrk = count($arwrk);
	for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
		$selwrk = "";
		for ($ari = 0; $ari < count($armultiwrk); $ari++) {
			if (strval($arwrk[$rowcntwrk][0]) == trim(strval($armultiwrk[$ari]))) {
				$selwrk = " checked";
				break;
			}
		}
?>
<?php echo ew_RepeatColumnTable($rowswrk, $rowcntwrk, 5, 1) ?>
<input type="checkbox" name="x_mv_active[]" id="x_mv_active[]" value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?><?php echo $movie->mv_active->EditAttributes() ?>>
<?php echo $arwrk[$rowcntwrk][1] ?>
<?php echo ew_RepeatColumnTable($rowswrk, $rowcntwrk, 5, 2) ?>
<?php
	}
}
?>
</span></td>
	</tr>
</table>
<p>
<input type="button" name="btnAction" id="btnAction" value="   Edit   " onClick="ew_SubmitForm(this.form);">
</form>
<script type="text/javascript">
<!--
ew_CreateEditor();  // Create DHTML editor(s)

//-->
</script>
<script language="JavaScript">
<!--
var f = document.fmovieedit;
ew_AjaxUpdateOpt(f.x_sub_id, f.x_parent_id, false);

//-->
</script>
<script language="JavaScript" type="text/javascript">
<!--

// Write your table-specific startup script here
// document.write("page loaded");
//-->

</script>
<?php include "footer.php" ?>
<?php

// If control is passed here, simply terminate the page without redirect
Page_Terminate();

// -----------------------------------------------------------------
//  Subroutine Page_Terminate
//  - called when exit page
//  - clean up connection and objects
//  - if url specified, redirect to url, otherwise end response
function Page_Terminate($url = "") {
	global $conn;

	// Page unload event, used in current page
	Page_Unload();

	// Global page unloaded event (in userfn*.php)
	Page_Unloaded();

	 // Close Connection
	$conn->Close();

	// Go to url if specified
	if ($url <> "") {
		ob_end_clean();
		header("Location: $url");
	}
	exit();
}
?>
<?php

// Function Get upload files
function GetUploadFiles() {
	global $objForm, $movie;

	// Get upload data
		if ($movie->mv_smallimg->Upload->UploadFile()) {

			// No action required
		} else {
			echo $movie->mv_smallimg->Upload->Message;
			exit();
		}
		if ($movie->mv_bigimg->Upload->UploadFile()) {

			// No action required
		} else {
			echo $movie->mv_bigimg->Upload->Message;
			exit();
		}
}
?>
<?php

// Load form values
function LoadFormValues() {

	// Load from form
	global $objForm, $movie;
	$movie->id->setFormValue($objForm->GetValue("x_id"));
	$movie->mv_id->setFormValue($objForm->GetValue("x_mv_id"));
	$movie->parent_id->setFormValue($objForm->GetValue("x_parent_id"));
	$movie->sub_id->setFormValue($objForm->GetValue("x_sub_id"));
	$movie->mv_name->setFormValue($objForm->GetValue("x_mv_name"));
	$movie->mv_name_en->setFormValue($objForm->GetValue("x_mv_name_en"));
	$movie->mv_content->setFormValue($objForm->GetValue("x_mv_content"));
	$movie->mv_detail->setFormValue($objForm->GetValue("x_mv_detail"));
	$movie->mv_harddisk->setFormValue($objForm->GetValue("x_mv_harddisk"));
	$movie->mv_path->setFormValue($objForm->GetValue("x_mv_path"));
	$movie->mv_capacity->setFormValue($objForm->GetValue("x_mv_capacity"));
	$movie->mv_year->setFormValue($objForm->GetValue("x_mv_year"));
	$movie->mv_subtitles->setFormValue($objForm->GetValue("x_mv_subtitles"));
	$movie->mv_resolution->setFormValue($objForm->GetValue("x_mv_resolution"));
	$movie->mv_price->setFormValue($objForm->GetValue("x_mv_price"));
	$movie->mv_dateadd->setFormValue($objForm->GetValue("x_mv_dateadd"));
	$movie->mv_dateadd->CurrentValue = ew_UnFormatDateTime($movie->mv_dateadd->CurrentValue, 7);
	$movie->mv_status->setFormValue($objForm->GetValue("x_mv_status"));
	$movie->mv_homepage->setFormValue($objForm->GetValue("x_mv_homepage"));
	$movie->mv_active->setFormValue($objForm->GetValue("x_mv_active"));
}

// Restore form values
function RestoreFormValues() {
	global $movie;
	$movie->id->CurrentValue = $movie->id->FormValue;
	$movie->mv_id->CurrentValue = $movie->mv_id->FormValue;
	$movie->parent_id->CurrentValue = $movie->parent_id->FormValue;
	$movie->sub_id->CurrentValue = $movie->sub_id->FormValue;
	$movie->mv_name->CurrentValue = $movie->mv_name->FormValue;
	$movie->mv_name_en->CurrentValue = $movie->mv_name_en->FormValue;
	$movie->mv_content->CurrentValue = $movie->mv_content->FormValue;
	$movie->mv_detail->CurrentValue = $movie->mv_detail->FormValue;
	$movie->mv_harddisk->CurrentValue = $movie->mv_harddisk->FormValue;
	$movie->mv_path->CurrentValue = $movie->mv_path->FormValue;
	$movie->mv_capacity->CurrentValue = $movie->mv_capacity->FormValue;
	$movie->mv_year->CurrentValue = $movie->mv_year->FormValue;
	$movie->mv_subtitles->CurrentValue = $movie->mv_subtitles->FormValue;
	$movie->mv_resolution->CurrentValue = $movie->mv_resolution->FormValue;
	$movie->mv_price->CurrentValue = $movie->mv_price->FormValue;
	$movie->mv_dateadd->CurrentValue = $movie->mv_dateadd->FormValue;
	$movie->mv_dateadd->CurrentValue = ew_UnFormatDateTime($movie->mv_dateadd->CurrentValue, 7);
	$movie->mv_status->CurrentValue = $movie->mv_status->FormValue;
	$movie->mv_homepage->CurrentValue = $movie->mv_homepage->FormValue;
	$movie->mv_active->CurrentValue = $movie->mv_active->FormValue;
}
?>
<?php

// Load row based on key values
function LoadRow() {
	global $conn, $Security, $movie;
	$sFilter = $movie->SqlKeyFilter();
	if (!is_numeric($movie->id->CurrentValue)) {
		return FALSE; // Invalid key, exit
	}
	$sFilter = str_replace("@id@", ew_AdjustSql($movie->id->CurrentValue), $sFilter); // Replace key value

	// Call Row Selecting event
	$movie->Row_Selecting($sFilter);

	// Load sql based on filter
	$movie->CurrentFilter = $sFilter;
	$sSql = $movie->SQL();
	if ($rs = $conn->Execute($sSql)) {
		if ($rs->EOF) {
			$LoadRow = FALSE;
		} else {
			$LoadRow = TRUE;
			$rs->MoveFirst();
			LoadRowValues($rs); // Load row values

			// Call Row Selected event
			$movie->Row_Selected($rs);
		}
		$rs->Close();
	} else {
		$LoadRow = FALSE;
	}
	return $LoadRow;
}

// Load row values from recordset
function LoadRowValues(&$rs) {
	global $movie;
	$movie->id->setDbValue($rs->fields('id'));
	$movie->mv_id->setDbValue($rs->fields('mv_id'));
	$movie->parent_id->setDbValue($rs->fields('parent_id'));
	$movie->sub_id->setDbValue($rs->fields('sub_id'));
	$movie->mv_name->setDbValue($rs->fields('mv_name'));
	$movie->mv_name_en->setDbValue($rs->fields('mv_name_en'));
	$movie->mv_smallimg->Upload->DbValue = $rs->fields('mv_smallimg');
	$movie->mv_bigimg->Upload->DbValue = $rs->fields('mv_bigimg');
	$movie->mv_content->setDbValue($rs->fields('mv_content'));
	$movie->mv_detail->setDbValue($rs->fields('mv_detail'));
	$movie->mv_harddisk->setDbValue($rs->fields('mv_harddisk'));
	$movie->mv_path->setDbValue($rs->fields('mv_path'));
	$movie->mv_capacity->setDbValue($rs->fields('mv_capacity'));
	$movie->mv_year->setDbValue($rs->fields('mv_year'));
	$movie->mv_subtitles->setDbValue($rs->fields('mv_subtitles'));
	$movie->mv_resolution->setDbValue($rs->fields('mv_resolution'));
	$movie->mv_price->setDbValue($rs->fields('mv_price'));
	$movie->mv_dateadd->setDbValue($rs->fields('mv_dateadd'));
	$movie->mv_status->setDbValue($rs->fields('mv_status'));
	$movie->mv_homepage->setDbValue($rs->fields('mv_homepage'));
	$movie->mv_active->setDbValue($rs->fields('mv_active'));
}
?>
<?php

// Render row values based on field settings
function RenderRow() {
	global $conn, $Security, $movie;

	// Call Row Rendering event
	$movie->Row_Rendering();

	// Common render codes for all row types
	// id

	$movie->id->CellCssStyle = "";
	$movie->id->CellCssClass = "";

	// mv_id
	$movie->mv_id->CellCssStyle = "";
	$movie->mv_id->CellCssClass = "";

	// parent_id
	$movie->parent_id->CellCssStyle = "";
	$movie->parent_id->CellCssClass = "";

	// sub_id
	$movie->sub_id->CellCssStyle = "";
	$movie->sub_id->CellCssClass = "";

	// mv_name
	$movie->mv_name->CellCssStyle = "";
	$movie->mv_name->CellCssClass = "";

	// mv_name_en
	$movie->mv_name_en->CellCssStyle = "";
	$movie->mv_name_en->CellCssClass = "";

	// mv_smallimg
	$movie->mv_smallimg->CellCssStyle = "";
	$movie->mv_smallimg->CellCssClass = "";

	// mv_bigimg
	$movie->mv_bigimg->CellCssStyle = "";
	$movie->mv_bigimg->CellCssClass = "";

	// mv_content
	$movie->mv_content->CellCssStyle = "";
	$movie->mv_content->CellCssClass = "";

	// mv_detail
	$movie->mv_detail->CellCssStyle = "";
	$movie->mv_detail->CellCssClass = "";

	// mv_harddisk
	$movie->mv_harddisk->CellCssStyle = "";
	$movie->mv_harddisk->CellCssClass = "";

	// mv_path
	$movie->mv_path->CellCssStyle = "";
	$movie->mv_path->CellCssClass = "";

	// mv_capacity
	$movie->mv_capacity->CellCssStyle = "";
	$movie->mv_capacity->CellCssClass = "";

	// mv_year
	$movie->mv_year->CellCssStyle = "";
	$movie->mv_year->CellCssClass = "";

	// mv_subtitles
	$movie->mv_subtitles->CellCssStyle = "";
	$movie->mv_subtitles->CellCssClass = "";

	// mv_resolution
	$movie->mv_resolution->CellCssStyle = "";
	$movie->mv_resolution->CellCssClass = "";

	// mv_price
	$movie->mv_price->CellCssStyle = "";
	$movie->mv_price->CellCssClass = "";

	// mv_dateadd
	$movie->mv_dateadd->CellCssStyle = "";
	$movie->mv_dateadd->CellCssClass = "";

	// mv_status
	$movie->mv_status->CellCssStyle = "";
	$movie->mv_status->CellCssClass = "";

	// mv_homepage
	$movie->mv_homepage->CellCssStyle = "";
	$movie->mv_homepage->CellCssClass = "";

	// mv_active
	$movie->mv_active->CellCssStyle = "";
	$movie->mv_active->CellCssClass = "";
	if ($movie->RowType == EW_ROWTYPE_VIEW) { // View row
	} elseif ($movie->RowType == EW_ROWTYPE_ADD) { // Add row
	} elseif ($movie->RowType == EW_ROWTYPE_EDIT) { // Edit row

		// id
		$movie->id->EditCustomAttributes = "";
		$movie->id->EditValue = $movie->id->CurrentValue;
		$movie->id->CssStyle = "";
		$movie->id->CssClass = "";
		$movie->id->ViewCustomAttributes = "";

		// mv_id
		$movie->mv_id->EditCustomAttributes = "";
		$movie->mv_id->EditValue = ew_HtmlEncode($movie->mv_id->CurrentValue);

		// parent_id
		$movie->parent_id->EditCustomAttributes = "";
		$sSqlWrk = "SELECT `parent_id`, `parent_name` FROM `parent`";
		$sSqlWrk .= " ORDER BY `parent_order` Desc";
		$rswrk = $conn->Execute($sSqlWrk);
		$arwrk = ($rswrk) ? $rswrk->GetRows() : array();
		if ($rswrk) $rswrk->Close();
		array_unshift($arwrk, array("", "Please Select"));
		$movie->parent_id->EditValue = $arwrk;

		// sub_id
		$movie->sub_id->EditCustomAttributes = "";
		$sSqlWrk = "SELECT `sub_id`, `sub_name`, `parent_id` FROM `subcat`";
		if (trim(strval($movie->sub_id->CurrentValue)) == "") {
			$sSqlWrk .= " WHERE 0=1";
		} else {
			$sSqlWrk .= " WHERE `sub_id` = " . ew_AdjustSql($movie->sub_id->CurrentValue) . "";
		}
		$sSqlWrk .= " AND (" . "`sub_type`='4'" . ")";
		$rswrk = $conn->Execute($sSqlWrk);
		$arwrk = ($rswrk) ? $rswrk->GetRows() : array();
		if ($rswrk) $rswrk->Close();
		array_unshift($arwrk, array("", "Please Select", ""));
		$movie->sub_id->EditValue = $arwrk;

		// mv_name
		$movie->mv_name->EditCustomAttributes = "";
		$movie->mv_name->EditValue = ew_HtmlEncode($movie->mv_name->CurrentValue);

		// mv_name_en
		$movie->mv_name_en->EditCustomAttributes = "";
		$movie->mv_name_en->EditValue = ew_HtmlEncode($movie->mv_name_en->CurrentValue);

		// mv_smallimg
		$movie->mv_smallimg->EditCustomAttributes = "";
		$movie->mv_smallimg->EditValue = $movie->mv_smallimg->CurrentValue;

		// mv_bigimg
		$movie->mv_bigimg->EditCustomAttributes = "";
		$movie->mv_bigimg->EditValue = $movie->mv_bigimg->CurrentValue;

		// mv_content
		$movie->mv_content->EditCustomAttributes = "";
		$movie->mv_content->EditValue = ew_HtmlEncode($movie->mv_content->CurrentValue);

		// mv_detail
		$movie->mv_detail->EditCustomAttributes = "";
		$movie->mv_detail->EditValue = ew_HtmlEncode($movie->mv_detail->CurrentValue);

		// mv_harddisk
		$movie->mv_harddisk->EditCustomAttributes = "";
		$movie->mv_harddisk->EditValue = ew_HtmlEncode($movie->mv_harddisk->CurrentValue);

		// mv_path
		$movie->mv_path->EditCustomAttributes = "";
		$movie->mv_path->EditValue = ew_HtmlEncode($movie->mv_path->CurrentValue);

		// mv_capacity
		$movie->mv_capacity->EditCustomAttributes = "";
		$movie->mv_capacity->EditValue = ew_HtmlEncode($movie->mv_capacity->CurrentValue);

		// mv_year
		$movie->mv_year->EditCustomAttributes = "";
		$movie->mv_year->EditValue = ew_HtmlEncode($movie->mv_year->CurrentValue);

		// mv_subtitles
		$movie->mv_subtitles->EditCustomAttributes = "";
		$movie->mv_subtitles->EditValue = ew_HtmlEncode($movie->mv_subtitles->CurrentValue);

		// mv_resolution
		$movie->mv_resolution->EditCustomAttributes = "";
		$movie->mv_resolution->EditValue = ew_HtmlEncode($movie->mv_resolution->CurrentValue);

		// mv_price
		$movie->mv_price->EditCustomAttributes = "";
		$sSqlWrk = "SELECT `pr_id`, `pr_price` FROM `price`";
		$rswrk = $conn->Execute($sSqlWrk);
		$arwrk = ($rswrk) ? $rswrk->GetRows() : array();
		if ($rswrk) $rswrk->Close();
		array_unshift($arwrk, array("", "Please Select"));
		$movie->mv_price->EditValue = $arwrk;

		// mv_dateadd
		$movie->mv_dateadd->EditCustomAttributes = "";
		$movie->mv_dateadd->EditValue = ew_HtmlEncode(ew_FormatDateTime($movie->mv_dateadd->CurrentValue, 7));

		// mv_status
		$movie->mv_status->EditCustomAttributes = "";
		$arwrk = array();
		$arwrk[] = array("1", "Phim HD");
		$arwrk[] = array("2", "Phim bo");
		$arwrk[] = array("3", "Phim khoa hoc - tai lieu");
		$arwrk[] = array("4", "Ca nhac");
		$movie->mv_status->EditValue = $arwrk;

		// mv_homepage
		$movie->mv_homepage->EditCustomAttributes = "";
		$arwrk = array();
		$arwrk[] = array("1", "Home Page");
		$movie->mv_homepage->EditValue = $arwrk;

		// mv_active
		$movie->mv_active->EditCustomAttributes = "";
		$arwrk = array();
		$arwrk[] = array("1", "Active");
		$movie->mv_active->EditValue = $arwrk;
	} elseif ($movie->RowType == EW_ROWTYPE_SEARCH) { // Search row
	}

	// Call Row Rendered event
	$movie->Row_Rendered();
}
?>
<?php

// Update record based on key values
function EditRow() {
	global $conn, $Security, $movie;
	$sFilter = $movie->SqlKeyFilter();
	if (!is_numeric($movie->id->CurrentValue)) {
		return FALSE;
	}
	$sFilter = str_replace("@id@", ew_AdjustSql($movie->id->CurrentValue), $sFilter); // Replace key value
	$movie->CurrentFilter = $sFilter;
	$sSql = $movie->SQL();
	$conn->raiseErrorFn = 'ew_ErrorFn';
	$rs = $conn->Execute($sSql);
	$conn->raiseErrorFn = '';
	if ($rs === FALSE)
		return FALSE;
	if ($rs->EOF) {
		$EditRow = FALSE; // Update Failed
	} else {

		// Save old values
		$rsold =& $rs->fields;
		$rsnew = array();

		// Field id
		// Field mv_id

		$movie->mv_id->SetDbValueDef($movie->mv_id->CurrentValue, "");
		$rsnew['mv_id'] =& $movie->mv_id->DbValue;

		// Field parent_id
		$movie->parent_id->SetDbValueDef($movie->parent_id->CurrentValue, NULL);
		$rsnew['parent_id'] =& $movie->parent_id->DbValue;

		// Field sub_id
		$movie->sub_id->SetDbValueDef($movie->sub_id->CurrentValue, NULL);
		$rsnew['sub_id'] =& $movie->sub_id->DbValue;

		// Field mv_name
		$movie->mv_name->SetDbValueDef($movie->mv_name->CurrentValue, "");
		$rsnew['mv_name'] =& $movie->mv_name->DbValue;

		// Field mv_name_en
		$movie->mv_name_en->SetDbValueDef($movie->mv_name_en->CurrentValue, NULL);
		$rsnew['mv_name_en'] =& $movie->mv_name_en->DbValue;

		// Field mv_smallimg
		$movie->mv_smallimg->Upload->SaveToSession(); // Save file value to Session
		if ($movie->mv_smallimg->Upload->Action == "2" || $movie->mv_smallimg->Upload->Action == "3") { // Update/Remove
		$movie->mv_smallimg->DbValue = $rs->fields('mv_smallimg'); // Get original value
		if (is_null($movie->mv_smallimg->Upload->Value)) {
			$movie->mv_smallimg->Upload->DbValue = NULL;
		} else {
			$movie->mv_smallimg->Upload->DbValue = ew_UploadFileNameEx(ew_UploadPathEx(TRUE, "../upload_img/movie/"), $movie->mv_smallimg->Upload->FileName);
		}
		$rsnew['mv_smallimg'] =& $movie->mv_smallimg->Upload->DbValue;
		}

		// Field mv_bigimg
		$movie->mv_bigimg->Upload->SaveToSession(); // Save file value to Session
		if ($movie->mv_bigimg->Upload->Action == "2" || $movie->mv_bigimg->Upload->Action == "3") { // Update/Remove
		$movie->mv_bigimg->DbValue = $rs->fields('mv_bigimg'); // Get original value
		if (is_null($movie->mv_bigimg->Upload->Value)) {
			$movie->mv_bigimg->Upload->DbValue = NULL;
		} else {
			$movie->mv_bigimg->Upload->DbValue = ew_UploadFileNameEx(ew_UploadPathEx(TRUE, "../userfiles/image/hinh phim/"), $movie->mv_bigimg->Upload->FileName);
		}
		$rsnew['mv_bigimg'] =& $movie->mv_bigimg->Upload->DbValue;
		}

		// Field mv_content
		$movie->mv_content->SetDbValueDef($movie->mv_content->CurrentValue, NULL);
		$rsnew['mv_content'] =& $movie->mv_content->DbValue;

		// Field mv_detail
		$movie->mv_detail->SetDbValueDef($movie->mv_detail->CurrentValue, NULL);
		$rsnew['mv_detail'] =& $movie->mv_detail->DbValue;

		// Field mv_harddisk
		$movie->mv_harddisk->SetDbValueDef($movie->mv_harddisk->CurrentValue, NULL);
		$rsnew['mv_harddisk'] =& $movie->mv_harddisk->DbValue;

		// Field mv_path
		$movie->mv_path->SetDbValueDef($movie->mv_path->CurrentValue, NULL);
		$rsnew['mv_path'] =& $movie->mv_path->DbValue;

		// Field mv_capacity
		$movie->mv_capacity->SetDbValueDef($movie->mv_capacity->CurrentValue, NULL);
		$rsnew['mv_capacity'] =& $movie->mv_capacity->DbValue;

		// Field mv_year
		$movie->mv_year->SetDbValueDef($movie->mv_year->CurrentValue, NULL);
		$rsnew['mv_year'] =& $movie->mv_year->DbValue;

		// Field mv_subtitles
		$movie->mv_subtitles->SetDbValueDef($movie->mv_subtitles->CurrentValue, NULL);
		$rsnew['mv_subtitles'] =& $movie->mv_subtitles->DbValue;

		// Field mv_resolution
		$movie->mv_resolution->SetDbValueDef($movie->mv_resolution->CurrentValue, NULL);
		$rsnew['mv_resolution'] =& $movie->mv_resolution->DbValue;

		// Field mv_price
		$movie->mv_price->SetDbValueDef($movie->mv_price->CurrentValue, NULL);
		$rsnew['mv_price'] =& $movie->mv_price->DbValue;

		// Field mv_dateadd
		$movie->mv_dateadd->SetDbValueDef(ew_UnFormatDateTime($movie->mv_dateadd->CurrentValue, 7), NULL);
		$rsnew['mv_dateadd'] =& $movie->mv_dateadd->DbValue;

		// Field mv_status
		$movie->mv_status->SetDbValueDef($movie->mv_status->CurrentValue, NULL);
		$rsnew['mv_status'] =& $movie->mv_status->DbValue;

		// Field mv_homepage
		$movie->mv_homepage->SetDbValueDef($movie->mv_homepage->CurrentValue, NULL);
		$rsnew['mv_homepage'] =& $movie->mv_homepage->DbValue;

		// Field mv_active
		$movie->mv_active->SetDbValueDef($movie->mv_active->CurrentValue, NULL);
		$rsnew['mv_active'] =& $movie->mv_active->DbValue;

		// Call Row Updating event
		$bUpdateRow = $movie->Row_Updating($rsold, $rsnew);
		if ($bUpdateRow) {

		// Field mv_smallimg
			if (!is_null($movie->mv_smallimg->Upload->Value)) ew_SaveFile(ew_UploadPathEx(TRUE, "../upload_img/movie/"), $rsnew['mv_smallimg'], $movie->mv_smallimg->Upload->Value);

		// Field mv_bigimg
			if (!is_null($movie->mv_bigimg->Upload->Value)) ew_SaveFile(ew_UploadPathEx(TRUE, "../userfiles/image/hinh phim/"), $rsnew['mv_bigimg'], $movie->mv_bigimg->Upload->Value);
			$conn->raiseErrorFn = 'ew_ErrorFn';
			$EditRow = $conn->Execute($movie->UpdateSQL($rsnew));
			$conn->raiseErrorFn = '';
		} else {
			if ($movie->CancelMessage <> "") {
				$_SESSION[EW_SESSION_MESSAGE] = $movie->CancelMessage;
				$movie->CancelMessage = "";
			} else {
				$_SESSION[EW_SESSION_MESSAGE] = "Update cancelled";
			}
			$EditRow = FALSE;
		}
	}

	// Call Row Updated event
	if ($EditRow) {
		$movie->Row_Updated($rsold, $rsnew);
	}
	$rs->Close();

	// Field mv_smallimg
	$movie->mv_smallimg->Upload->RemoveFromSession(); // Remove file value from Session

	// Field mv_bigimg
	$movie->mv_bigimg->Upload->RemoveFromSession(); // Remove file value from Session
	return $EditRow;
}
?>
<?php

// Page Load event
function Page_Load() {

	//echo "Page Load";
}

// Page Unload event
function Page_Unload() {

	//echo "Page Unload";
}
?>
